// A complex number (a number in the form a + bi where i = sqrt(-1))
Complex
	var
		real
		imaginary

	New(r = 0, i = 0)
		src.real = r
		src.imaginary = i
		return ..()

	proc
		Abs()
			return sqrt(src.real*src.real + src.imaginary*src.imaginary)

		Add(Complex/C)
			if(isnum(C)) C = new(C)
			return new/Complex(src.real + C.real, src.imaginary + C.imaginary)

		Conjugate()
			var/Complex/C = src.Copy()
			C.imaginary *= -1
			return C

		Copy()
			return new/Complex(src.real, src.imaginary)

		Equals(Complex/C)
			return src.real == C.real && src.imaginary == C.imaginary

		Multiply(Complex/C)
			if(isnum(C)) C = new(C)
			return new/Complex(src.real * C.real - src.imaginary * C.imaginary,
							   src.real * C.imaginary + src.imaginary * C.real)
